<template>
    <div>
      <h1>已提现列表</h1>
      <div class="z">
        <el-table :data="cashouts" stripe style="width: 100%">
          <el-table-column prop="cashoutOrderId" label="提现ID" width="100" />
          <el-table-column prop="wid" label="跑腿员ID" width="100" />
          <el-table-column prop="workerName" label="名字" width="150" />
          <el-table-column prop="cashoutValue" label="提现金额" width="150" />
          <el-table-column prop="time" label="提现时间" width="300" />
          <el-table-column prop="ways" label="提现方式" width="250" />
          <el-table-column prop="workerPhonenum" label="跑腿员手机号"  />
        </el-table>
      </div>
      
      <div class="pagination-container">
        <el-pagination
        class="pagination"
        @current-change="handleCurrentChange"
        :current-page="pagination.currentPage"
        :page-size="pagination.pageSize"
        layout="total,prev,pager,next,jumper"
        :total="pagination.total"
        ></el-pagination>
      </div>
    </div>
  </template>
  
  <script setup>
  import { getApi,postApi,deleteApi,updateApi} from '@/util/api'
  </script>
  
  <script>
    export default {
        data() {
          
            return {
                cashouts: [],
                pagination:{
            currentPage:1,//当前页码
            pageSize:7,//一页多少条
            total:0
          }  
          ,
            }
        },
        created(){
          this.getAll();
        }
        ,
        methods:{
          //分页
          getAll(){
            getApi("admin/cashout/"+this.pagination.currentPage+"/"+this.pagination.pageSize+"?state=2").then((rs)=>{
                this.pagination.pageSize = rs.data.data.size;
                this.pagination.currentPage = rs.data.data.current;
                this.pagination.total = rs.data.data.total;
                this.cashouts=rs.data.data.records;
                console.log(this.cashouts)
                }).catch(error=>{
                    alert(error);
                })
          },
          handleCurrentChange(currentPage){
            //修改页码值为当前选中页码值
            this.pagination.currentPage = currentPage;
            //执行查询
            this.getAll();
          },
        }
        ,
        mounted() {

        },
    }
  </script>
  
  
  <style lang="scss" scoped>
  .pagination-container{
    position: absolute;
    right: 70px;
    margin-top: 40px;
  }

  .z{
    margin-top: 30px;
  }
  </style>